"""注册表模块"""

from typing import Dict, Any, Optional
from .logger import CommandLogger

class Registry:
    """注册表类"""

    def __init__(self):
        self._registry: Dict[str, Any] = {}
        self.logger = CommandLogger()

    def register(self, name: str, obj: Any) -> None:
        """注册对象"""
        self._registry[name] = obj

    def get(self, name: str) -> Optional[Any]:
        """获取对象"""
        return self._registry.get(name)

    def remove(self, name: str) -> None:
        """移除对象"""
        if name in self._registry:
            del self._registry[name]

# 创建全局注册表实例
bera = Registry()